package com.component;

import java.awt.Dimension;
import java.awt.Graphics;

import javax.swing.ImageIcon;
import javax.swing.JPanel;

public class GifPanel extends JPanel{
	private ImageIcon img = null;
	
	public GifPanel( ImageIcon img ){
		this.img = img;
	}
	
    protected void paintComponent(Graphics g) {
    	g.drawImage(img.getImage(), 0, 0, this);
    	this.setPreferredSize(new Dimension(img.getIconWidth(), img.getIconHeight()));
    	this.setSize(img.getIconWidth(), img.getIconHeight());
    }
    
    public int getWidth() {
    	return img.getIconWidth();
    }
    
    public int getHeight() {
    	return img.getIconHeight();
    }
}
